package application.translators.impl;

import application.model.FeatureModel;
import application.model.FeaturesModel;
import application.translators.Translator;
import mappings.Features;

import java.util.List;

public class FeaturesTranslator implements Translator<List<Features>, FeaturesModel>
{
    @Override
    public FeaturesModel translate(List<Features> input)
    {
        FeaturesModel featuresModel = new FeaturesModel();

        for(Features feature : input)
        {
            FeatureModel featureModel = new FeatureModel();

            featureModel.setId(feature.getId());
            featureModel.setName(feature.getName());

            featuresModel.addFeature(featureModel);
        }

        return featuresModel;
    }
}
